rm -rf zhcramfsTMP

gcc -static -m32 zserver.c -o zserver

cp -r initramfs/  zhcramfsTMP
cp -f zserver  zhcramfsTMP/x86-busybox/bin/

sed -i 's/.*zhc$/ ifconfig eth0 192.168.2.252   netmask 255.255.255.0\n  ifconfig eth1 192.168.8.252 netmask 255.255.255.0\n echo 1 > \/proc\/sys\/net\/ipv6\/conf\/eth1\/disable_ipv6 \n ifconfig \n  echo 1 > \/proc\/sys\/net\/ipv4\/ip_forward \n zserver /g'  zhcramfsTMP/x86-busybox/init

cd  zhcramfsTMP/x86-busybox
find . | cpio -o --format=newc  | gzip -9  > ../../../initramfs.busybox1.27.2.i386.cpio.VM0.gz

cd ../../../

sudo qemu-system-i386 -m 50M  -net nic,macaddr=00:aa:00:60:00:01,model=ne2k_pci  -net tap,ifname=tap0  \
  -kernel linux-3.18.5/arch/x86/boot/bzImage -initrd initramfs.busybox1.27.2.i386.cpio.VM0.gz  \
  -nographic -append "console=ttyS0" \
  -net nic,macaddr=00:aa:00:60:00:02,vlan=1,model=ne2k_pci   -net socket,vlan=1,mcast=239.192.168.1:1102


